<template>
  <!-- 撤回消息展示 -->
  <div class="withdraw-class">
    <span style="margin-right: 2px;">{{ name }}</span>撤回了一条消息
  </div>
</template>

<script>
import {loadUserSummerCache} from "@/utils/storage";

export default {
  props: {
    msgInfo: {
      type: Object,
      require: true,
    }
  },
  data() {
    return {
        currUid: this.$store.state.user.currentUser.uid,
    }
  },
  computed: {
    name() {
      if (this.msgInfo.uid === this.currUid) {
        // 本人
        return "你";
      } else {
         let user = loadUserSummerCache(this.msgInfo.uid);
         return user[0].nickname;
      }
    }
  }
}
</script>

<style scoped>
.withdraw-class {
  color: lightgray;
  font-size: 12px;
  clear: both;
  display: flex;
  justify-content: center; /* 水平居中 */
}
</style>